package com.job.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;

import javax.persistence.ManyToOne;

import javax.persistence.Table;

@Entity
@Table(name = "sorder")
public class Sorder implements Serializable {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;// 管理员编号，自动增长
	@Column(length = 20)
	private String name;// 收件人名字
	@Column(precision = 8, scale = 2)
	private BigDecimal price;// 购买时商品的价格
	@Column(nullable = false)
	private Integer number;// 购买的数量
	@ManyToOne
	@JoinColumn(name = "pid")
	private Product product;
	@ManyToOne
	@JoinColumn(name = "fid")
	private Forder forder;

	public Sorder() {
		super();
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Forder getForder() {
		return forder;
	}

	public void setForder(Forder forder) {
		this.forder = forder;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	@Override
	public int hashCode() {
		// TODO 自动生成的方法存根
		return super.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		// TODO 自动生成的方法存根
		return super.equals(obj);
	}

	@Override
	public String toString() {
		// TODO 自动生成的方法存根
		return super.toString();
	}
	
}
